package com.baizhi.Api;

import com.baizhi.entity.Album;
import com.baizhi.service.AlbumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("albumApi")
public class AlbumApi {

    @Autowired(required = false)
    private AlbumService albumService;

    @GetMapping("testAlbum/{page},{limit},{albumName}")
    public Map select(@PathVariable("page") int page,@PathVariable("limit") int limit,@PathVariable("albumName") String albumName){
        return albumService.selectAll(page, limit, albumName);
    }

    @GetMapping("testAlbumOne/{id}")
    public Album selectOne(@PathVariable("id") int id){
        return albumService.selectOne(id);
    }
}
